package com.example.forum.dataTranfer;

import com.example.forum.commons.tools.Transfer.DataTransfer;
import com.example.forum.entity.TAppuser;
import com.example.forum.entity.TUsers;
import com.example.forum.service.ITAppuserService;
import com.example.forum.service.ITUsersService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @author 2
 * @date 2020-04-30 11:32
 */

@SpringBootTest
public class ObjectTOObject {

    @Autowired
    private DataTransfer dataTransfer;

    @Autowired
    private ITAppuserService appuserService;

    @Autowired
    private ITUsersService usersService;


    @Test
    public void test() {

        String userID = "2B19600A-1D74-42D9-B7DC-F1F9F841E902";
        TUsers users = usersService.getById(userID);

        TAppuser tAppuser = new TAppuser();
        dataTransfer.getObjectFromObject(tAppuser,users);
        System.out.println(tAppuser.toString());
        System.out.println(users.toString());

        dataTransfer.getEntityFromDto(tAppuser,users);
        System.out.println(tAppuser.toString());
        System.out.println(users.toString());

    }


    
}
